{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">Tags管理</div>
    <div class="layui-card-body">
        <div class="layui-form">
            <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
        </div>
    </div>
</div>
<script type="text/html" id="barTool">
    <a data-open='{:url("edit")}?id={{ d.id }}' class="layui-btn layui-btn-xs" title="编辑">编辑</a>
    <a href='{:url("del")}?ids={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del">删除</a>
</script>
{/block}
{block name="script"}
<script>
    layui.use(['yznTable'], function() {
        var table = layui.yznTable;

        var init = {
            table_elem: '#currentTable',
            delete_url: "{:url('del')}",
            modify_url: '{:url("multi")}',
        };

        table.render({
            init: init,
            id: 'currentTable',
            toolbar: ['refresh','delete',
                [{
                    html:'<a class="layui-btn layui-btn-sm layui-btn-warm" href="{:url("create")}"><i class="iconfont icon-warning"></i>&nbsp;数据重建</a>'
                }],
            ],
            url: '{:url("index")}',
            cols: [
                [
                    { type: 'checkbox', fixed: 'left' },
                    { field: 'listorder', width: 70, title: '排序', edit: 'text' },
                    { field: 'tag', align: "left", title: 'Tags名称' },
                    { field: 'tagdir', align: "left", width: 200, title: '拼音' },
                    { field: 'usetimes', width: 100, title: '信息总数' },
                    { field: 'hits', width: 100, title: '点击量' },
                    { field: 'url',width: 60,align:"center", title: 'URL',templet:table.url,search:false},
                    { field: 'create_time', width: 180, title: '创建时间', search: 'range' },
                    { field: 'update_time', width: 180, title: '更新时间', search: 'range' },
                    { fixed: 'right', width: 150, title: '操作', toolbar: '#barTool' }
                ]
            ],
            page: {}
        });
    });
</script>
{/block}